package com.company.clientscard.main.widgets;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;

public class MainWidget extends Composite {

	private static MyBinderWidgetUiBinder uiBinder = GWT
			.create(MyBinderWidgetUiBinder.class);

	interface MyBinderWidgetUiBinder extends UiBinder<Widget, MainWidget> {
	}

	@UiField
	HTMLPanel mainPanel;

	// @UiField
	// VerticalPanel myPanelContent;

	public MainWidget() {
		initWidget(uiBinder.createAndBindUi(this));

		mainPanel.setWidth("100%");
		mainPanel.setHeight(Window.getClientHeight() + "px");
		Window.addResizeHandler(new ResizeHandler() {

			@Override
			public void onResize(ResizeEvent event) {
				int height = event.getHeight();
				mainPanel.setHeight(height + "px");
			}
		});
	}
}
